Matplotlib Library allows basic to advanced plotting. Matplotlib is extremely flexible and fluid, so you have no limitations on what you can create and how it looks
import numpy as np
import matplotlib.pyplot as plt
x = np.array([ 'Morocco','Germany','France', 'Canada','USA'])
y1 = np.array([10,20,30,40,50])
y2 = np.array([15,25,35,45,55])
# Create a figure with two subplots
fig, (ax1,ax2) = plt.subplots( nrows = 1, ncols =2, figsize = (16,4)) # ax1 represents the first subplot and ax2 the second one
ax1.bar(x,y1, color = 'Purple')
ax1.set_xlabel('categories')
ax1.set_ylabel('Values')
ax1.set_title('Column Chart')
ax2.barh(x,y2, color = 'orange')
ax2.set_xlabel('categories')
ax2.set_ylabel('Values')
ax2.set_title('Horizontal bar chart')
# prevent overlapping of the subplots and adjust the layout
plt.tight_layout()
plt.show()
Seaborn is a data visualization library built on top of Matplotlib. It is often used because it makes attractive visualizations and works easily with Pandas.
import seaborn as sns
import matplotlib.pyplot as plt
# Load a built in dataset based on US State car crash percentages
crash_df = sns.load_dataset('car_crashes')
# Styling
sns.set_style('white')
# You can use figure sizing from Matplotlib
plt.figure(figsize=(8,4))
sns.set_context('paper', font_scale=1.4)
sns.jointplot(x='speeding', y='alcohol', data=crash_df, kind='reg')
sns.despine(left=False, bottom=False)
<Figure size 800x400 with 0 Axes>

By using Plotly, a static diagram becomes fully interactive; you can switch between viewing single or multiple data points at the same time.
import plotly.express as px
import pandas as pd
import numpy as np
import plotly
plotly.offline.init_notebook_mode()
# Allows us to create graph objects for making more customized plots
import plotly.graph_objects as go
# Use included Google price data to make one plot
df_stocks = px.data.stocks() # google price data # px=> Plotly Express provides functions to visualize a variety of types of data.
px.line(df_stocks, x='date', y='GOOG', labels={'x':'Date', 'y':'Price'}) # x-axis be labeled as date and y-axis as price
# # Make multiple line plots
# px.line(df_stocks, x='date', y=['GOOG','AAPL'], labels={'x':'Date', 'y':'Price'},
# title='Apple Vs. Google')
# Create a figure to which I'll add plots
fig = go.Figure()
# You can pull individual columns of data from the dataset and use markers or not
fig.add_trace(go.Scatter(x=df_stocks.date, y=df_stocks.AAPL,
mode='lines', name='Apple'))
fig.add_trace(go.Scatter(x=df_stocks.date, y=df_stocks.AMZN,
mode='lines+markers', name='Amazon'))
# You can create custom lines (Dashes : dash, dot, dashdot)
fig.add_trace(go.Scatter(x=df_stocks.date, y=df_stocks.GOOG,
mode='lines+markers', name='Google',
line=dict(color='firebrick', width=2, dash='dashdot')))
# Go crazy styling the figure
fig.update_layout(
# Shows gray line without grid, styling fonts, linewidths and more
xaxis=dict(
showline=True,
showgrid=False,
showticklabels=True,
linecolor='rgb(204, 204, 204)',
linewidth=2,
ticks='outside',
tickfont=dict(
family='Arial',
size=12,
color='rgb(82, 82, 82)',
),
),
# Turn off everything on y axis
yaxis=dict(
showgrid=False,
zeroline=False,
showline=False,
showticklabels=False,
),
autosize=False,
margin=dict(
autoexpand=False,
l=100,
r=20,
t=110,
),
showlegend=False,
plot_bgcolor='white'
)
# Display pop data for countries in Europe in 2007 greater than 2000000
df_europe = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6")
fig = px.bar(df_europe, y='pop', x='country', text='pop', color='country')
# Put bar total value above bars with 2 values of precision
fig.update_traces(texttemplate='%{text:.2s}', textposition='outside')
# Set fontsize and uniformtext_mode='hide' says to hide the text if it won't fit
fig.update_layout(uniformtext_minsize=8)
# Rotate labels 45 degrees
fig.update_layout(xaxis_tickangle=-45)